package com.zqxq.lottery.common.utils;


import com.alibaba.fastjson.JSONObject;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class Test {

    public static void main(String[] args) {
        testBetVal();
//        testBetVal();
//        testSelectCM();
//        testBallBunch();
    }

    public static void testBetNum(){
        Integer[][] betList = new Integer[][]{{1,2,3},{1,2,3}};
        int num = FootBallBetUtils.betNum("1-1".split(","),betList);
        System.out.println(num);
    }

    public static void testBetVal(){
        /*Map<String,String>  oddsMap= JSONObject.parseObject("{\"0\": \"2.09\", \"1\": \"3.30\", \"2\": \"2.87\", \"3\": \"4.20\", \"4\": \"3.95\", \"5\": \"1.57\", \"6\": \"3.25\", \"7\": \"12.00\", \"8\": \"26.00\", \"9\": \"5.40\", \"10\": \"5.50\", \"11\": \"6.75\", \"12\": \"22.00\", \"13\": \"12.00\", \"14\": \"4.20\", \"15\": \"8.00\", \"16\": \"10.50\", \"17\": \"7.50\", \"18\": \"21.00\", \"19\": \"16.00\", \"20\": \"21.00\", \"21\": \"50.00\", \"22\": \"40.00\", \"23\": \"50.00\", \"24\": \"125.0\", \"25\": \"100.0\", \"26\": \"150.0\", \"27\": \"50.00\", \"28\": \"12.50\", \"29\": \"6.50\", \"30\": \"11.00\", \"31\": \"40.00\", \"32\": \"250.0\", \"33\": \"10.00\", \"34\": \"15.00\", \"35\": \"9.00\", \"36\": \"32.00\", \"37\": \"21.00\", \"38\": \"23.00\", \"39\": \"70.00\", \"40\": \"50.00\", \"41\": \"60.00\", \"42\": \"200.0\", \"43\": \"150.0\", \"44\": \"200.0\", \"45\": \"60.00\", \"46\": \"12.50\", \"47\": \"4.80\", \"48\": \"3.55\", \"49\": \"3.45\", \"50\": \"4.80\", \"51\": \"8.00\", \"52\": \"14.00\", \"53\": \"21.00\"}", Map.class);
        Double[] m1 = FootBallBetUtils.getMinMaxOdds("1,2,3,4,5,6,7,8,9,10",oddsMap);
        Double[] m2 = FootBallBetUtils.getMinMaxOdds("11,12,15,24",oddsMap);
        List<Double[]> list = new ArrayList();
        list.add(m1);list.add(m2);
        System.out.println(FootBallBetUtils.betMinVal("2-1".split(","), list));
        System.out.println(FootBallBetUtils.betMaxVal("2-1".split(","), list));*/
    }

    public static void testSelectCM(){
        String[][] t = new String[][]{{"201_1","201_2","201_3"},{"202_2","202_3","202_4"},{"203_1","203_2"}};
        Combination cm = new Combination(String.class);
        List<Object[]> list = new ArrayList();
        cm.selectCP(list,t,0,new Integer[t.length]);
        for(Object[] arr:list){
            for(Object i:arr){
                System.out.print(i+" ");
            }
            System.out.println();
        }

    }

    public static void testBallBunch(){
        Integer[][] betList = new Integer[][]{{1,2,3},{53}};
        Map<Integer, List<BallBunch>>  rs = FootBallBetUtils.getBallBunch(10,1,betList,false);
        for (BallBunch b: rs.get(1)){
            System.out.println(b.getCode());
        }
        for (BallBunch b: rs.get(2)){
            System.out.println(b.getCode());
        }
    }


}
